package com.assignwork.modules.workarrange;

import com.assignwork.dto.DailyPlanRemarkSubmitDTO;
import com.assignwork.dto.WorkArrangeOtherSubmitDTO;
import com.assignwork.service.IDailyPlanRemarkService;
import com.assignwork.vo.DailyPlanRemarkVO;
import com.assignwork.vo.WorkArrangeFixedMachineVO;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName DailyPlanRemarkController
 * @Description 昼夜计划备注前端控制器
 * @Author dujianyu
 * @Date 2023/12/24 14:43
 */
@RestController
@AllArgsConstructor
@RequestMapping("workArrange/planRemark")
public class DailyPlanRemarkController extends BladeController {

    private IDailyPlanRemarkService service;

    @PostMapping("submit")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "新增或修改", notes = "传入dto")
    public R<Boolean> submitRemark(@RequestBody DailyPlanRemarkSubmitDTO dto) {
        return R.status(service.submitRemark(dto));
    }

    @GetMapping("/remarkByPlanId")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "备注信息", notes = "传入planId")
    public R<DailyPlanRemarkVO> remarkByPlanId(String planId) {
        return R.data(service.remarkByPlanId(Func.toLong(planId)));
    }
}
